<? include_once("header_common.phtml");?>
    <body>
        <div class="container">
            <div id="header">
                <div class="user_login_box">
                    <?php
                    $auth = Zend_Auth::getInstance ();
                    if (!$auth->hasIdentity()) {

                        echo '<a href="/' . $this->lang . '/user/register">' . $this->translate('new user') . '</a> ' .
                        $this->translate('or') . ' ';
                        echo '<a href="/' . $this->lang . '/auth/login">' . $this->translate('login') . '</a>';
                    } else {

                        $auth_username = $auth->getIdentity()->username;
                        $auth_userid = $auth->getIdentity()->id;

                        echo $this->translate('hello,') . '<b>&nbsp;<a href="/' .
                        $this->lang . '/profile/' . $this->escape($auth_username) . '">' . $this->escape($auth_username) . '</a></b> ';

                        //check messages
                        // if ( $this->checkMessages > 0) {
                        echo '| <a title="' . $this->translate('new messages') . '" href="/' . $this->lang . '/message/received">
                            <img src="/images/icons/ico_email.gif" />&nbsp;<b>' . $this->checkMessages . '</b>
                            </a> ';
                        //}
                        echo'| ' . '<a href="/' . $this->lang . '/auth/logout">' .
                        $this->translate('logout') . '</a>';
                    }
                    ?>
                </div>

                <h1 id="site-name"><a href="/" title="nolotiro.org home"><img src="/images/nolotiro_logo.png" alt="nolotiro.org" id="logo" /> nolotiro.org</a></h1>
                <h2 id='site-slogan'><?= $this->translate('no lo tiro, te lo regalo (sin condiciones)') ?></h2>

                 <div class="home_location_change">
                    <?php
                    //location change form
                    require_once APPLICATION_PATH . '/forms/LocationChange.php';
                    $form = new Form_LocationChange;
                    $form->setAction('/' . $this->lang . '/location/change');
                    $form->loadDefaultDecoratorsIsDisabled(false);
                    foreach ($form->getElements() as $element) {
                        $element->removeDecorator('DtDdWrapper');
                        $element->removeDecorator('Label');
                    }
                    //echo $form;
                    ?>

                    

                    <div class="ad_create_tab ad_create_tab_home">
                    <?php echo
                        '<a href="/'.$this->lang.'/location/change2/?location='.$this->escape($this->suggestIP).'" > '.
                                $this->translate('View ads in').' '.$this->suggestIP .'</a>';?>
                </div>
                    
                     
                </div>


            </div>

            <?php echo $this->layout()->content ?>

                    <div id="footer">
                        <div class="links-right">
                            <a href='/<?= $this->lang ?>/page/about'><?= $this->translate('about'); ?></a>
                            | <a href='/<?= $this->lang ?>/page/faqs'><?= $this->translate('faqs'); ?></a>
                            | <a href='/<?= $this->lang ?>/ad/listall/ad_type/give'><?= $this->translate('all the ads'); ?></a>
                            | <?= ($this->lang == 'es') ? "<a href='/en/index/setlang'>english</a>" : "<a href= '/es/index/setlang'>español</a>"; ?>

                        </div>

                        <div id="info" class="innerWrap clearfix">
                            <p>
                        <?= $this->translate('nolotiro.org is a website where you can give away things you no longer want or no longer need to pick them up other people who may serve or be of much use.');
                        ?>
                    </p>
                </div>
                <div  class="links-left">
                    <a href="/<?= $this->lang ?>/page/tos"><?= $this->translate('terms of use'); ?></a> |
                    <a href="/<?= $this->lang ?>/page/privacy"><?= $this->translate('privacy policy'); ?></a> |
                    <a href="http://code.google.com/p/nolotiro/"><?= $this->translate('developers'); ?></a> |
                    <a href='/<?= $this->lang ?>/contact'><?= $this->translate('contact'); ?></a> |
                    <a href='http://www.pledgie.com/campaigns/12750'><?= $this->translate('donate'); ?></a>
                </div>
            </div>
        </div>

        <script type="text/javascript">
            var uservoiceOptions = {
                key: 'nolotiro',
                host: 'nolotiro.uservoice.com',
                forum: '<?
                        if ($this->lang == 'es') {
                            echo '30282';
                        }

                        if ($this->lang == 'en') {
                            echo '76487';
                        }
                        ?>',
                                lang: '<?= $this->lang ?>',
                                showTab: true,
                                alignment: 'left',
                                background_color: '#999',
                                hover_color: '#00ACCF'
                            };
                            function _loadUserVoice() {
                                var s = document.createElement('script');
                                s.src = ("https:" == document.location.protocol ? "https://" : "http://") + "cdn.uservoice.com/javascripts/widgets/tab.js";
                                document.getElementsByTagName('head')[0].appendChild(s);
                            }
                            _loadSuper = window.onload;
                            window.onload = (typeof window.onload != 'function') ? _loadUserVoice : function() { _loadSuper(); _loadUserVoice(); };
        </script>



    </body>
</html>
<? //=Zend_Version::VERSION; ?>
